#pragma once

#include<iostream>
#include<memory>
#include<unordered_map>
#include"Listener.hpp"
#include"Epoller.hpp"
#include"Connection.hpp"

class TcpServer
{
    public:
    TcpServer():_epoller_ptr(std::make_unique<Epoller>())
    {}
    void Start()
    {
        while(true)
        {
            _epoller_ptr->Wait();
        }
    }
    ~TcpServer()
    {}
    private:
    std::unique_ptr<Epoller> _epoller_ptr;
    std::shared_ptr<Listener> _listener_ptr;
    std::unordered_map<int,std::shared_ptr<Connection>> _connections;
};
